package com.mazaiting.web.domain.base;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 基础分页请求对象
 */
@Setter
@Getter
@ToString
public class BasePageQuery {

    /**
     * 页数
     */
    @NotNull(message = "页码不能为空")
    @Min(value = 1, message = "页码最小值为 1")
    private int pageNum = 1;

    /**
     * 每页记录数
     */
    @NotNull(message = "每页条数不能为空")
    @Range(min = 1, max = 1000, message = "每页条数，取值范围 1-1000")
    private int pageSize = 10;
}
